/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ages.sound

import scala.collection.mutable.Queue

object SoundBufferManager {
  
  val soundQueue = new Queue[Sound]()

  def enqueueSound(snd:Sound)
  {
    soundQueue.enqueue(snd)
  }

  def bufferSoundQueue()
  {
    while(!soundQueue.isEmpty)
      {
        bufferSound(soundQueue.dequeue)
      }
  }

 private def bufferSound(snd:Sound)
 {
   println(snd)
   val buf = ALLoader.load(snd.filename)
    snd.soundBuffer.bufferNumber = buf
    snd.loaded = true
 }

}
